package wang.hex.codetransfer.code.gui;

import java.awt.*;
import java.awt.image.BufferedImage;

/**
 * @Author wujie
 * @Class SnapShot
 * @Description
 * @Date 2021/1/6 9:58
 */
public class SnapShot {

    public static BufferedImage snapShot(int x, int y, int height, int weight) {
        try {
            BufferedImage screenshot = (new Robot()).createScreenCapture(new Rectangle(x, y, height, weight));
            return screenshot;
        } catch (AWTException e) {
            e.printStackTrace();
        }
        return null;
    }


}
